//下划线私有属性不可访问
var handler={
    get(target,property){
        invariant(property,'get');
        return target[property];
    },
    set(target,property,value){
        invariant(property,'set');
        target[property]=value;
        return true;
    }
}

function invariant(key,action){
    if(key[0]==='_'){
        throw new Error(`Invalid attempt to ${action} private "${key}" property`);
    }
}

let proxy=new Proxy({},handler);
proxy._prop